package com.zhiyou.demo.controller;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.zhiyou.demo.model.AdminModel;
import com.zhiyou.demo.service.IAdminService;

@Controller
@RequestMapping("/")
public class AdminController {

	@Autowired
	IAdminService adminService;
	
	@RequestMapping("admin.do")
	public String admin(Model model){
		List<AdminModel> list=adminService.queryAdminModel();
		model.addAttribute("list", list);
		return "admin";
	}
	
	@ResponseBody
	@RequestMapping("submit.do")
	public Object submitData(HttpServletRequest  request){
		
				
		return "submit";
	}
}
